package com.zy.experience_system.repository;

import com.zy.experience_system.dto.StuAndSetDTO;
import com.zy.experience_system.entity.StuAndSet;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface StuAndSetRepository extends JpaRepository<StuAndSet,Integer> {
    List<StuAndSet> findAllByStuId(String stuId);
    @Transactional
    void deleteBySetIdAndStuId(Integer setId, String stuId);
    List<StuAndSet> findAllBySetId(Integer setId);
    List<StuAndSet> findAllBySetIdAndOpen(Integer setId,String open);
    StuAndSet findByStuIdAndSetId(String stuId,Integer setId);
    List<StuAndSet> findAllByStuIdAndSetId(String stuId,Integer setId);
    List<StuAndSet> findAllBySetIdAndOpenOrderByTotalScoreDesc(Integer setId,String open);
}
